package com.shortvedio.search.api;

import com.shortvedio.base.model.Result;
import com.shortvedio.search.service.CommentsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class CommentsController {

    @Autowired
    private CommentsService commentsService;


    @GetMapping("/getRootComments")//查看根评论
    public Result getRootComments(@RequestParam Long videoId) {
        Result rootCommentsByVideoId = commentsService.getRootCommentsByVideoId(videoId);

        return rootCommentsByVideoId;
    }

    @GetMapping("/getReplyComments")//查看回复评论
    public Result getReplyComments(@RequestParam Long videoId, @RequestParam Long parentId) {
        Result replyComments = commentsService.getReplyComments(videoId, parentId);

        return replyComments;
    }
}
